(function () {
	var ns = ij.pkg('core').namespaceString;
	ij.core.Viewport = ij.core.Container.extend({
		init: function (config) {
			return this._super(ij.apply({
				classname: ns+'.Viewport',
				classes: ['ij-object', 'ij-container', 'ij-viewport'],
				renderer: {
					classname: 'ij.core.ViewportDomRenderer'
				},
				uid: (new Date()).valueOf().toString()
			}, config));
		},
		add: function (object) {
			if (object) {
				if (!(object instanceof ij.core.Scene)) {
					if (object instanceof ij.core.DisplayObject) {
						this._super(null);
						return this;
					}
					object = new ij.core.Layer(object);
				}
				this._super(object);
			}
			
			return this;
		}
	});
})();